#include<bits/stdc++.h>
using namespace std;
struct node2{
    int a;
    int id;
};
const int MAXN=1e5+5;
int n;
node2 fmaxn[MAXN];
struct node{
    int v;
    bool att,b;
}a[MAXN];
bool cmp(node x,node y) {
    return x.v<y.v;
}
bool check() {
    for(int i=1;i<=n;i++) {
        if(a[i].att==0 && a[i].b==0) return 0;
    }
    return 1;
}
bool equ() {
    int beg;
    for(int i=1;i<=n;i++) {
        if(a[i].b==0 && a[i].att==0){beg=a[i].v;break;}
    }
    for(int i=1;i<=n;i++) {
        if(a[i].b==0&& a[i].att==0)
            if((a[i].v!=beg)) return 0;
    }
    return 1;
}
int main() {
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++) {
        cin>>a[i].v;
    }
    sort(a+1,a+1+n,cmp);
    for(int i=n-1;i>=1;i--) {
        if(a[i].v<a[i+1].v) {
            fmaxn[i].a=a[i+1].v;fmaxn[i].id=i+1;
        }
        else {
            fmaxn[i].a=fmaxn[i+1].a;
            fmaxn[i].id=fmaxn[i+1].id;
        }
    }
    //for(int i=1;i<=n;i++) cout<<fmaxn[i]<<" ";
    //cout<<endl;
    while(!check()) {
        if(equ()){
            for(int i=1;i<=n;i++) {
                a[i].att=1;
            }
            break;
        }
        for(int i=1;i<=n;i++) {
            if(a[i].b!=1){
                //if(a[fmaxn[i].id].att==0)
                for(int j=i+1;j<=n;j++) {
                    if(a[j].v>a[i].v && a[j].att==0) {
                        a[i].b=1;
                        a[j].att=1;
                        //printf("number%d(%d) destroyed number%d(%d)\n",j,a[j],i,a[i]);
                        break;
                    }
                }
            }
        }
    }
    /*for(int i=1;i<=n;i++) {
        printf("number%d:%d attack:%d broken:%d\n",i,a[i].v,a[i].att,a[i].b);
    }*/
    int cnt=0;
    for(int i=1;i<=n;i++) {
        if(a[i].att==1 && a[i].b==0) cnt++;
    }
    cout<<cnt<<endl;
    return 0;
}
